﻿using Architecture.Domain.Service;
using MediatR;
using RBAC.ZhuBoLin.Application.Command.RoleCommand.Menu;

namespace RBAC.ZhuBoLin.Application.CommandHandlers.RoleHandler.Menu
{
    public class MenuDeleteCommandHandler : IRequestHandler<MenuDeleteCommand, int>
    {
        private readonly IMenuSerivice menuSerivice;

        public MenuDeleteCommandHandler(IMenuSerivice menuSerivice)
        {
            this.menuSerivice = menuSerivice;
        }

        public Task<int> Handle(MenuDeleteCommand request, CancellationToken cancellationToken)
        {
            return menuSerivice.DeleteMenu(request.id);
        }
    }
}
